<h1><?php echo $this->translate('Users'); ?></h1>
<?php echo $this->items->renderPages($this); ?>
<table class="listing">
    <tr>
        <th style="width: 40px"><?php echo $this->translate('#'); ?></th>
        <th><?php echo $this->translate('Username'); ?></th>
        <th><?php echo $this->translate('Firstname'); ?></th>
        <th><?php echo $this->translate('Middlename'); ?></th>
        <th><?php echo $this->translate('Lastname'); ?></th>
        <th><?php echo $this->translate('Group'); ?></th>
        <th style="width: 80px"><?php echo $this->translate('Action'); ?></th>
    </tr>
    <?php
    foreach ($this->items as $item) :
        $editUrl = $this->url(array('action' => 'edit', 'id' => $item->id));
        $deleteUrl = $this->url(array('action' => 'delete', 'id' => $item->id));
    ?>
    <tr>
        <td class="center"><?php echo $item->id; ?></td>
        <td><a href="<?php echo $editUrl; ?>"><?php echo $item->name; ?></a></td>
        <td><?php echo $item->firstName; ?></td>
        <td><?php echo $item->middleName; ?></td>
        <td><?php echo $item->lastName; ?></td>
        <td class="center"><?php echo $item->groupName; ?></td>
        <td class="center">
            <a class="remove" href="<?php echo $deleteUrl; ?>"><img alt="<?php echo $this->translate('Delete'); ?>" title="<?php echo $this->translate('Delete'); ?>" src="<?php echo LIGHT_ASSETS_URL; ?>/images/icons/32/Delete.png" /></a>
        </td>
    </tr>
    <?php endforeach; ?>
</table>
<?php echo $this->items->renderPages($this); ?>
<input type="submit" name="save" value="<?php echo $this->translate('Add'); ?>" />
<script type="text/javascript">
//<![CDATA[
$(document).ready(function () {
	$('input[name="save"]').click(function () {
		window.location.href = '<?php echo $this->url(array('action' => 'add', 'page' => null)); ?>';
		return false;
	});
    $('.remove').click(function () {
        if (confirm('<?php echo $this->translate('Are you sure'); ?>')) {
            return true;
        }
        return false;
    });
});
//]]>
</script>